﻿using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;

namespace Best.SmartCms.API
{
    /// <summary>
    /// 
    /// </summary>
    public class Program
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            BuildWebHost(args).Run();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static IWebHost BuildWebHost(string[] args)
        {
            var config = new ConfigurationBuilder()
                .AddJsonFile("appsettings.json", optional: true)
                .Build();
            return WebHost.CreateDefaultBuilder(args)
                 .UseKestrel(option => option.AddServerHeader = false)
                 .UseUrls("http://*:5001")
                 .UseConfiguration(config)
                 .CaptureStartupErrors(true)
                 .UseStartup<Startup>()
                 .Build();
        }

       
    }
}
